<?php
require 'connection.php';
$id=$_SESSION['logged_id'];
$query="select email,name,surname,login from users where id=".$id;
$result=mysql_query($query);
$count=mysql_num_rows($result);
if($count==1){
	$rows=mysql_fetch_array($result);
	$login=$rows['login'];
	$name=$rows['name'];
	$surname=$rows['surname'];
	$email=$rows['email'];
}else{
	echo 'error';
}
mysql_close();
?>